
/*
 * @Descripttion: 驼峰命名转横杠
 * @Author: ziwei
 * @Date: 2022-09-09 09:49:47
 * @LastEditors: ziwei
 * @LastEditTime: 2022-09-09 10:36:31
 */
export default {}

type RemoveFirst<T> = T extends `-${infer R}`?R:T
type KebabCase<T,Prev extends string=''> = T extends `${infer L}${infer R}`?KebabCase<R,`${Prev}${L extends Uppercase<L>?`-${Lowercase<L>}`:L}`>:RemoveFirst<Prev>

type A1 = KebabCase<'HandleOpenFlag'>
type A2 = KebabCase<'OpenFlag'>